---
title: Sequential Workflows
description: Linear, deterministic processes where each step depends on the output of the previous step.
---

Sequential workflows ensure predictable execution order and clear data flow between steps.

**Example Flow**: Research → Data Processing → Content Creation → Final Review

Sequential workflows ensure predictable execution order and clear data flow between steps.

```python sequential_workflow.py
from agno.workflow import Step, Workflow, StepOutput

def data_preprocessor(step_input):
    # Custom preprocessing logic

    # Or you can also run any agent/team over here itself
    # response = some_agent.run(...)
    return StepOutput(content=f"Processed: {step_input.input}") # <-- Now pass the agent/team response in content here

workflow = Workflow(
    name="Mixed Execution Pipeline",
    steps=[
        research_team,      # Team
        data_preprocessor,  # Function
        content_agent,      # Agent
    ]
)

workflow.print_response("Analyze the competitive landscape for fintech startups", markdown=True)
```

<Note>
  For more information on how to use custom functions, refer to the
  [Workflow with custom function step](/concepts/workflows/workflow-patterns/custom-function-step-workflow) page.
</Note>

**See Example**:

- [Sequence of Functions and Agents](/examples/concepts/workflows/01-basic-workflows/sequence_of_functions_and_agents) - Complete workflow with functions and agents

<Note>
`StepInput` and `StepOutput` provides standardized interfaces for data flow between steps:
So if you make a custom function as an executor for a step, make sure that the input and output types are compatible with the `StepInput` and `StepOutput` interfaces.
This will ensure that your custom function can seamlessly integrate into the workflow system.

Take a look at the schemas for [`StepInput`](/reference/workflows/step_input) and [`StepOutput`](/reference/workflows/step_output).

</Note>